
package edu.tgc.web.form.system;

import java.util.Date;
import java.util.Set;
import java.util.UUID;

import javax.validation.constraints.Pattern;

import org.abyss.common.web.controller.CommonCrudController.createValidate;
import org.abyss.common.web.controller.CommonCrudController.updateValidate;
import org.springframework.format.annotation.DateTimeFormat;

import edu.tgc.entity.hrm.IdCade;
import edu.tgc.entity.system.SysDept;
import edu.tgc.web.form.hrm.HrmEmployeeForm;
import edu.tgc.web.form.system.validation.ValidateDescription;
import edu.tgc.web.form.system.validation.ValidateUsername;

public class SysUserForm extends HrmEmployeeForm<UUID> {

    public interface passwordValidate {
    }
    protected IdCade cade;
    protected SysDept dept;
    @ValidateDescription(groups = { createValidate.class, updateValidate.class })
    protected String description;
    protected Boolean enabled = true;
    protected String ip;
    @Pattern(groups = passwordValidate.class, regexp = "^.{8,31}$", message = "密码必须为8到31位的字符组成")
    protected String password;
    protected Set<String> positionIds;
    protected Set<String> roleIds;
    protected Integer sort = 1;
    @ValidateUsername(groups = { createValidate.class, updateValidate.class })
    protected String username;
    protected String lastPassword;
    protected Date createTimeB;
    
    public SysDept getDept() {
        return this.dept;
    }

    public String getDescription() {
        return this.description;
    }

    public Boolean getEnabled() {
        return this.enabled;
    }

    public String getIp() {
        return this.ip;
    }

    public String getPassword() {
        return this.password;
    }

    public Set<String> getPositionIds() {
        return this.positionIds;
    }

    public Set<String> getRoleIds() {
        return this.roleIds;
    }

    public Integer getSort() {
        return this.sort;
    }

    public String getUsername() {
        return this.username;
    }

    public void setDept(SysDept dept) {
        this.dept = dept;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }


    public void setPassword(String password) {
        this.password = password;
    }

    public void setPositionIds(Set<String> positionIds) {
        this.positionIds = positionIds;
    }

    public void setRoleIds(Set<String> roleIds) {
        this.roleIds = roleIds;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public void setUsername(String username) {
        this.username = username;
    }

	public IdCade getCade() {
		return cade;
	}

	public void setCade(IdCade cade) {
		this.cade = cade;
	}

	public String getLastPassword() {
		return lastPassword;
	}

	public void setLastPassword(String lastPassword) {
		this.lastPassword = lastPassword;
	}
	
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
	public Date getCreateTimeB() {
		return createTimeB;
	}

	public void setCreateTimeB(Date createTimeB) {
		this.createTimeB = createTimeB;
	}
    
    

}
